package com.naver.nosql.memcached.spymemcached;

import java.io.IOException;
import java.io.Serializable;
import java.net.InetSocketAddress;

import net.spy.memcached.MemcachedClient;

public class SimpleExample {
	public static class Dummy implements Serializable {
		private static final long serialVersionUID = 1L;
		public int a;
		public String b;

		public Dummy(int a, String b) {
			this.a = a;
			this.b = b;
		}
	}

	public static void main(String[] args) throws IOException {
		MemcachedClient c = new MemcachedClient(new InetSocketAddress("10.24.134.106", 11211));
		
		c.set("someKey", 300, new Dummy(1, "b"));
		Dummy d = (Dummy)c.get("someKey");
		System.out.println(d.a);
		System.out.println(d.b);
	}
}
